package org.jeecg.modules.achexampaperprojectitem.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.achexampaperprojectitem.entity.AchExamPaperProjectItem;
import org.jeecg.modules.achexampaperprojectitem.mapper.AchExamPaperProjectItemMapper;
import org.jeecg.modules.achexampaperprojectitem.service.IAchExamPaperProjectItemService;
import org.jeecg.modules.achexampaperprojectitem.vo.AchExamPaperProjectItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: ach_exam_paper_project_item
 * @author: baochangrong
 * @Date:   2022-03-16
 * @Version: V1.0
 */
@Service
public class AchExamPaperProjectItemServiceImpl extends ServiceImpl<AchExamPaperProjectItemMapper, AchExamPaperProjectItem> implements IAchExamPaperProjectItemService {


    @Autowired
    AchExamPaperProjectItemMapper achExamPaperProjectItemMapper;

    /**
     * 全部Vo查询 附带关联名称
     * listVoAll
     */
    @Override
    public IPage<AchExamPaperProjectItemVo> listVoAll(Page<AchExamPaperProjectItemVo> page, @Param("achExamPaperProjectItemVo") AchExamPaperProjectItemVo achExamPaperProjectItemVo){
        List<AchExamPaperProjectItemVo> achExamPaperProjectItemVoList1 = achExamPaperProjectItemMapper.listVoAll(page,achExamPaperProjectItemVo);
        return page.setRecords(achExamPaperProjectItemVoList1);
    }

    /**  根据试卷id 获取分项数据
     * listByAchExamPaperId
     * */
    @Override
    public IPage<AchExamPaperProjectItem> listByAchExamPaperId(Page<AchExamPaperProjectItem> page, String tenantId,String  examinationPaperId){
        List<AchExamPaperProjectItem> achExamPaperProjectItemList = achExamPaperProjectItemMapper.listByAchExamPaperId(page,tenantId,examinationPaperId);
        return page.setRecords(achExamPaperProjectItemList);
    }

    /**  根据试卷id 获取分项评分标准 Vo查询
     * 附带评分标准
     * getAchExamProjectItemStandard
     * */
    @Override
    public IPage<AchExamPaperProjectItemVo> getAchExamProjectItemStandard(Page<AchExamPaperProjectItemVo> page, String tenantId,String  examinationPaperId){
        List<AchExamPaperProjectItemVo> achExamPaperProjectItemList = achExamPaperProjectItemMapper.getAchExamProjectItemStandard(page,tenantId,examinationPaperId);
        return page.setRecords(achExamPaperProjectItemList);
    }

}
